package com.eclipse.e20200117_周考_servlet_curd.com.qf.crud.dao;

import java.util.List;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.eclipse.e20200117_周考_servlet_curd.com.qf.crud.utils.JDBCUtils;

public class StudentDao implements IStudentDao {
	private static Logger logger = LogManager.getLogger();
	private static final String SQLDELETE = "delete from student where name=?";
	private static final String SQLSELECT = "select * from student";
	private static final String SQLADD = "insert into student(name) values('1')";
	private static final String SQLUPDATE = "update student set name=?";

	@Override
	public void delete(String name) {
		JDBCUtils.update(SQLDELETE,name);
	}
	
	@Override
	public void update(String name) {
		JDBCUtils.update(SQLUPDATE,name);
	}
	
	@Override
	public void add() {
		JDBCUtils.update(SQLADD);
	}
	
	@Override
	public  List select(Class clz) {
		return JDBCUtils.select(SQLSELECT, clz);
	}
}
